Optimal. Leaf size=74 \[ -\frac {a^2 (B-C) \sin (c+d x)}{d}+\frac {a^2 (2 B+C) \tanh ^{-1}(\sin (c+d x))}{d}+\frac {B \tan (c+d x) \left (a^2 \cos (c+d x)+a^2\right )}{d}+a^2 x (B+2 C) \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.29, antiderivative size = 74, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 6, integrand size = 40, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.150, Rules used = {3029, 2975, 2968, 3023, 2735, 3770} \[ -\frac {a^2 (B-C) \sin (c+d x)}{d}+\frac {a^2 (2 B+C) \tanh ^{-1}(\sin (c+d x))}{d}+\frac {B \tan (c+d x) \left (a^2 \cos (c+d x)+a^2\right )}{d}+a^2 x (B+2 C) \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 2735
Rule 2968
Rule 2975
Rule 3023
Rule 3029
Rule 3770
Rubi steps
\begin {align*} \int (a+a \cos (c+d x))^2 \left (B \cos (c+d x)+C \cos ^2(c+d x)\right ) \sec ^3(c+d x) \, dx &=\int (a+a \cos (c+d x))^2 (B+C \cos (c+d x)) \sec ^2(c+d x) \, dx\\ &=\frac {B \left (a^2+a^2 \cos (c+d x)\right ) \tan (c+d x)}{d}+\int (a+a \cos (c+d x)) (a (2 B+C)-a (B-C) \cos (c+d x)) \sec (c+d x) \, dx\\ &=\frac {B \left (a^2+a^2 \cos (c+d x)\right ) \tan (c+d x)}{d}+\int \left (a^2 (2 B+C)+\left (-a^2 (B-C)+a^2 (2 B+C)\right ) \cos (c+d x)-a^2 (B-C) \cos ^2(c+d x)\right ) \sec (c+d x) \, dx\\ &=-\frac {a^2 (B-C) \sin (c+d x)}{d}+\frac {B \left (a^2+a^2 \cos (c+d x)\right ) \tan (c+d x)}{d}+\int \left (a^2 (2 B+C)+a^2 (B+2 C) \cos (c+d x)\right ) \sec (c+d x) \, dx\\ &=a^2 (B+2 C) x-\frac {a^2 (B-C) \sin (c+d x)}{d}+\frac {B \left (a^2+a^2 \cos (c+d x)\right ) \tan (c+d x)}{d}+\left (a^2 (2 B+C)\right ) \int \sec (c+d x) \, dx\\ &=a^2 (B+2 C) x+\frac {a^2 (2 B+C) \tanh ^{-1}(\sin (c+d x))}{d}-\frac {a^2 (B-C) \sin (c+d x)}{d}+\frac {B \left (a^2+a^2 \cos (c+d x)\right ) \tan (c+d x)}{d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.34, size = 143, normalized size = 1.93 \[ \frac {a^2 \left (B \tan (c+d x)-2 B \log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )+2 B \log \left (\sin \left (\frac {1}{2} (c+d x)\right )+\cos \left (\frac {1}{2} (c+d x)\right )\right )+B c+B d x+C \sin (c+d x)-C \log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )+C \log \left (\sin \left (\frac {1}{2} (c+d x)\right )+\cos \left (\frac {1}{2} (c+d x)\right )\right )+2 c C+2 C d x\right )}{d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.44, size = 108, normalized size = 1.46 \[ \frac {2 \, {\left (B + 2 \, C\right )} a^{2} d x \cos \left (d x + c\right ) + {\left (2 \, B + C\right )} a^{2} \cos \left (d x + c\right ) \log \left (\sin \left (d x + c\right ) + 1\right ) - {\left (2 \, B + C\right )} a^{2} \cos \left (d x + c\right ) \log \left (-\sin \left (d x + c\right ) + 1\right ) + 2 \, {\left (C a^{2} \cos \left (d x + c\right ) + B a^{2}\right )} \sin \left (d x + c\right )}{2 \, d \cos \left (d x + c\right )} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [B] time = 0.51, size = 155, normalized size = 2.09 \[ \frac {{\left (B a^{2} + 2 \, C a^{2}\right )} {\left (d x + c\right )} + {\left (2 \, B a^{2} + C a^{2}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right ) - {\left (2 \, B a^{2} + C a^{2}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right ) - \frac {2 \, {\left (B a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - C a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + B a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + C a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} - 1}}{d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.23, size = 107, normalized size = 1.45 \[ a^{2} B x +2 a^{2} C x +\frac {2 B \,a^{2} \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{d}+\frac {a^{2} B \tan \left (d x +c \right )}{d}+\frac {B \,a^{2} c}{d}+\frac {a^{2} C \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{d}+\frac {a^{2} C \sin \left (d x +c \right )}{d}+\frac {2 a^{2} C c}{d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.52, size = 105, normalized size = 1.42 \[ \frac {2 \, {\left (d x + c\right )} B a^{2} + 4 \, {\left (d x + c\right )} C a^{2} + 2 \, B a^{2} {\left (\log \left (\sin \left (d x + c\right ) + 1\right ) - \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + C a^{2} {\left (\log \left (\sin \left (d x + c\right ) + 1\right ) - \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + 2 \, C a^{2} \sin \left (d x + c\right ) + 2 \, B a^{2} \tan \left (d x + c\right )}{2 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 1.14, size = 161, normalized size = 2.18 \[ \frac {C\,a^2\,\sin \left (c+d\,x\right )}{d}+\frac {2\,B\,a^2\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d}+\frac {4\,B\,a^2\,\mathrm {atanh}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d}+\frac {4\,C\,a^2\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d}+\frac {2\,C\,a^2\,\mathrm {atanh}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d}+\frac {B\,a^2\,\sin \left (c+d\,x\right )}{d\,\cos \left (c+d\,x\right )} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F(-1)] time = 0.00, size = 0, normalized size = 0.00 \[ \text {Timed out} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________